var newsDetail = Vue.extend({

data(){
  return{
    classId:'',
    newsId:''
  };
},
mounted: function() {
    var reg = /\/newsDetail\/(\d+)\/(\d+)/;
    this.classId = this.$route.path.match(reg)[1];
    this.newsId = this.$route.path.match(reg)[2];
    console.log(this.classId , this.newsId);

    this.plus();
},

props: ['newsDet'],
methods: {
    plus(){
        if (this.newsId) {
            console.log(this.newsDet);
        } else {
            console.log(this.newsId);
        }
    },
    reduce(){

    }
},
watch:{
  $route(to){
    this.classId = this.$route.params.index;
    this.newsId = this.$route.params.innerIndex;
    //console.log(this.classId , this.productId);
  }
},
template:'\
<div class="right_zi">\
    <div class="bar clearfix">\
        <span class="b_tt">新闻资讯</span>\
        <span class="curbar">\
            <i>您当前的位置：</i>\
            <a href="index.html">首页</a>>\
            <a href="news.html">新闻资讯</a>>\
            <i>公司新闻</i>\
        </span>\
    </div>\
    <div class="news_show_zi">\
        <h4 v-text="newsDet.data[this.classId].newsList[this.newsId].name"></h4>\
        <div v-text="newsDet.data[this.classId].newsList[this.newsId].info"></div>\
    </div>\
</div>\
',

});